// 系统管理模块路由
import System from '@/pages/system'

// 用户管理模块
import SystemUser from '@/pages/system/user'
import SystemUserList from '@/pages/system/user/list'
import SystemUserEdit from '@/pages/system/user/edit'
import SystemUserAdd from '@/pages/system/user/add'

// 用户角色管理模块
import SystemRole from '@/pages/system/role'
import SystemRoleList from '@/pages/system/role/list'
import SystemRoleEdit from '@/pages/system/role/edit'
import SystemRoleAdd from '@/pages/system/role/add'

// 权限管理模块
import SystemScope from '@/pages/system/scope'
import SystemScopeList from '@/pages/system/scope/list'
import SystemScopeEdit from '@/pages/system/scope/edit'
import SystemScopeAdd from '@/pages/system/scope/add'

// 前端路由表模块
import SystemRoute from '@/pages/system/route'
import SystemRouteList from '@/pages/system/route/list'
import SystemRouteEdit from '@/pages/system/route/edit'
import SystemRouteAdd from '@/pages/system/route/add'
import SystemRouteChild from '@/pages/system/route/child'

const systemRoutes = {
  name: 'system',
  path: 'system',
  meta:{// 规定的访问权限账号
    requiresRole:[1]
  },
  component: System,
  children:[
    {
      path: 'user',
      component: SystemUser,
      redirect: 'user/list',
      children:[
        {
          path: 'list',
          component: SystemUserList
        },
        {
          path: 'edit/:uid',
          component: SystemUserEdit
        },
        {
          path: 'add',
          component: SystemUserAdd
        },
      ]
    },  
    {
      path: 'role',
      component: SystemRole,
      redirect: 'role/list',
      children:[
        {
          path: 'list',
          component: SystemRoleList
        },
        {
          path: 'edit/:uid',
          component: SystemRoleEdit
        },
        {
          path: 'add',
          component: SystemRoleAdd
        }
      ]
    },
    {
      path: 'scope',
      component: SystemScope,
      redirect: 'scope/list',
      children: [
        {
          path: 'list',
          component: SystemScopeList
        },
        {
          path: 'edit/:id',
          component: SystemScopeEdit
        },
        {
          path: 'add',
          component: SystemScopeAdd
        }
      ]
    },
    {
      path: 'route',
      component: SystemRoute,
      redirect: 'route/list',
      children: [
        {
          path: 'list',
          component: SystemRouteList
        },
        {
          path: 'edit',
          component: SystemRouteEdit
        },
        {
          path: 'add',
          component: SystemRouteAdd
        },
        {
          path: 'child',
          component: SystemRouteChild
        }
      ]
    }
  ]

}
export default systemRoutes
